#include<bits/stdc++.h>
using namespace std;
#define int long long

struct node {
	int x, y, domain;
} a[300005];

signed main() {
	int n;
	cin >> n;
	for (int i = 1; i <= n; i++) {
		cin >> a[i].x >> a[i].y;
		if (a[i].x >= 0 && a[i].y >= 0)
			a[i].domain = 1;
		else if (a[i].x < 0 && a[i].y >= 0)
			a[i].domain = 2;
		else if (a[i].x < 0 && a[i].y < 0)
			a[i].domain = 3;
		else if (a[i].x >= 0 && a[i].y < 0)
			a[i].domain = 4;
	}

	vector<pair<int, int>> axis(5);

	for (int i = 1; i <= n; i++) {
		for (int j = 1; j <= 4; j++) {
			if (abs(a[i].domain - j) != 2 && a[i].x + a[i].y > 0) {
				axis[j].first += a[i].x;
				axis[j].second += a[i].y;
			}
		}
	}

	int ans = 0;
	for (int i = 1; i <= 4; i++)
		ans = max(ans, abs(axis[i].first) + abs(axis[i].second));
	cout << ans;
	return 0;
}
